using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Brain
{
    public class TouchMenuEntry_Sprite : ITouchMenuEntry, IUpdateable, IDrawable
    {
        public Sprite Sprite;

        public Rectangle SelectionArea
        {
            get 
            {
                return Sprite.BoundsRectangle;
            }
        }

        public event SetVoid OnClicked;
        public void Clicked()
        {
            if (OnClicked != null)
            {
                OnClicked();
            }
        }

        public TouchMenuEntry_Sprite(Sprite sprite, TouchMenuSystem system)
        {
            this.Sprite = sprite;

            ShouldDraw = true;
            ShouldUpdate = true;

            system.AddEntry(this);
        }

        public bool ShouldDraw { get; set; }
        public bool ShouldUpdate { get; set; }

        public void Update()
        {
            if (Sprite.ShouldUpdate)
            {
                Sprite.Update();
            }
        }
        public void Draw()
        {
            if (Sprite.ShouldDraw)
            {
                Sprite.Draw();
            }
        }


        
    }
}
